Add 'magellanx' format for Explorist user waypoint (.upt) SD files.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 7 Jun 2005 15:36:42 +0000 (15:36 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 7 Jun 2005 15:36:42 +0000 (15:36 +0000)
gpsbabel/README
gpsbabel/magproto.c
gpsbabel/vecs.c

index 101fb43ef6c1c8f32788a943e93b5abfe74ef439..ad7ed3c5f180aa04ef64656f0ed4fd7fa73e5fbd 100644 (file)
@@ -134,6 +134,15 @@ THE FORMATS
        Additional sub options:
        baud: may be 1200, 2400, 4800, 9600, 19200, but must match receiver.
 
+    MAGELLANX
+
+       The SD card format used by the Magellan Explorist 300, 400, and 500.
+       It's identical to the Magellan SD format used by Meridian, but allows
+       longer waypoint names.
+       
+       You should name any file created with this format with a ".upt"
+       extension so the firmware can read it.
+
     GARMIN
 
         Waypoint serial upload and download works reliably under both
index 753fcd624783557ab606ef3307973abdeef676c8..48151b532ad93dc0d0ee7ea8da610c69a876f04e 100644 (file)
@@ -46,6 +46,7 @@ static char *noack = NULL;
 static char *nukewpt = NULL;
 static int route_out_count;
 static int waypoint_read_count;
+static int wpt_len = 8;
 
 typedef enum {
        mrs_handoff = 0,
@@ -365,7 +366,7 @@ mag_verparse(char *ibuf)
                case mm_meridian:
                case mm_sportrak:
                        icon_mapping = map330_icon_table;
-                       setshort_length(mkshort_handle, 8);
+                       setshort_length(mkshort_handle, wpt_len);
                        setshort_mustupper(mkshort_handle, 0);
                        mag_cleanse = m330_cleanse;
                        break;
@@ -794,7 +795,7 @@ mag_rd_init(const char *portname)
 }
 
 static void
-mag_wr_init(const char *portname)
+mag_wr_init_common(const char *portname)
 {
        if (bs) {
                bitrate=atoi(bs);
@@ -841,6 +842,24 @@ mag_wr_init(const char *portname)
        QUEUE_INIT(&rte_wpt_tmp);
 }
 
+/*
+ * Entry point for extended (explorist) points.
+ */
+static void
+magX_wr_init(const char *portname)
+{
+       wpt_len = 20;
+       mag_wr_init_common(portname);
+       setshort_length(mkshort_handle, wpt_len);
+}
+
+static void
+mag_wr_init(const char *portname)
+{
+       wpt_len = 8;
+       mag_wr_init_common(portname);
+}
+
 static void
 mag_deinit(void)
 {
@@ -1218,11 +1237,12 @@ mag_waypt_pr(const waypoint *waypointp)
        if (odesc && /* !is_file && */ (wptcmtcnt++ >= wptcmtcnt_max))
                odesc[0] = 0;
 
-       sprintf(obuf, "PMGNWPL,%4.3f,%c,%09.3f,%c,%07.lf,M,%-.8s,%-.46s,%s",
+       sprintf(obuf, "PMGNWPL,%4.3f,%c,%09.3f,%c,%07.lf,M,%-.*s,%-.46s,%s",
                lat, ilat < 0 ? 'S' : 'N',
                lon, ilon < 0 ? 'W' : 'E',
                waypointp->altitude == unknown_alt ?
                        0 : waypointp->altitude,
+               wpt_len,
                owpt,
                odesc,
                icon_token);
@@ -1441,3 +1461,18 @@ ff_vecs_t mag_fvecs = {
        NULL, 
        mag_fargs
 };
+
+/*
+ * Extended (Explorist) entry tables.
+ */
+ff_vecs_t magX_fvecs = {
+       ff_type_file,
+       FF_CAP_RW_ALL,
+       mag_rd_init,    
+       magX_wr_init,   
+       mag_deinit,     
+       mag_deinit,     
+       mag_read,
+       mag_write,
+       NULL, 
+};
index fd963f37755489b1ed7f860b3675e4e113d9df21..f524990c92a57f2d30275a7635d7b1fac4486980 100644 (file)
@@ -34,6 +34,7 @@ extern ff_vecs_t geo_vecs;
 extern ff_vecs_t gpx_vecs;
 extern ff_vecs_t mag_svecs;
 extern ff_vecs_t mag_fvecs;
+extern ff_vecs_t magX_fvecs;
 extern ff_vecs_t mapsend_vecs;
 extern ff_vecs_t mps_vecs;
 extern ff_vecs_t gpsutil_vecs;
@@ -112,9 +113,15 @@ vecs_t vec_list[] = {
        {
                &mag_fvecs,
                "magellan",
-               "Magellan SD files (as for Meridians)", 
+               "Magellan SD files (as for Meridian)", 
                NULL
        },
+       {
+               &magX_fvecs,
+               "magellanx",
+               "Magellan SD files (as for eXplorist)", 
+               "upt"
+       },
        {
                &mapsend_vecs,
                "mapsend",